#ifndef CHATTESTER_H
#define CHATTESTER_H

#include <QWidget>
#include <QTimer>

#include "autoclient.h"

namespace Ui {
class ChatTester;
}

class ChatTester : public QWidget
{
    Q_OBJECT

public slots:
    void slotAutoRegisterAndLogin(void);
    void slotAutoAddFriend(void);
    void slotAudoOnlineChat(void);
    void slotUpdateLcdDisplay(void);

public:
    explicit ChatTester(QWidget *parent = 0);
    ~ChatTester();

private slots:
    void on_pb_redister_clicked();
    void on_pb_login_clicked();
    void on_pb_addFriend_clicked();
    void on_pb_onlineChat_clicked();
    void on_pb_newConnect_clicked();

    void slotUserOnline(UserInfo info);
    void slotUserOffline(UserInfo info);
    void slotSelectMyClient(const QString &name);

    void on_pb_autoTest_clicked();

private:
    Ui::ChatTester *ui;

    QTimer *m_updateLcdTimer;
    QTimer *m_autoLoginTimer;
    QTimer *m_autoAddFriendTimer;
    QTimer *m_autoChatTimer;

    AutoClient *m_client;
    UserInfoList m_onlineUserList;
    ClientMap m_clientMap;
};

#endif // CHATTESTER_H
